package lambda;

import java.util.ArrayList;

/**
 * @author lyy
 * @date 2021/12/22
 */
public class LambdaTest {
    public static void main(String[] args) {
        // jdk8 之前创建线程
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("创建一个线程跑起来了");
            }
        }).start();

        // jdk8 使用 lambda 语法创建线程
        new Thread(() -> System.out.println("lambda")).start();

        System.out.println(compute(4, 5, (a, b) -> a*b ));
    }


    public static Integer compute(Integer a, Integer b, MyFunction<Integer, Integer> function){
       return function.compute(a, b);
    }
}
